package com.fwmagic.dp._3._3_1;

/**
 * 抽象工厂模式
 */
public class Main {
    public static void main(String[] args) {
        //第一条生产线，生产男性
        HumanFactory maleFactory = new MaleFactory();

        //第二条生产线，生产女性
        HumanFactory femaleFactory = new FemaleFactory();

        //生产一个黄色男性
        Human yellowHumanMale = maleFactory.createYellowHuman();
        yellowHumanMale.getColor();
        yellowHumanMale.getSex();
        yellowHumanMale.talk();

        System.out.println("===========================");

        //生产一个黄色女性
        Human yellowHumanFemale = femaleFactory.createYellowHuman();
        yellowHumanFemale.getColor();
        yellowHumanFemale.getSex();
        yellowHumanFemale.talk();

    }
}
